<template>
	<view>
		<view class="head_msg">
			<image class="image1" src="../../static/users/hearer.png" @click="personal" mode=""></image>
			<view class="name">
				山海未眠
			</view>

			<view class="date">
				10-05 04:55
			</view>

			<view class="guanzhu" @click="like=true" v-if="!like">
				关注
			</view>

			<view class="quguan" @click="like=false" v-if="like">
				取消关注
			</view>

			<u-swiper height="460" :effect3d="true" interval="3000" effect3d-previous-margin="0" mode="dot"
				@click="click" border-radius="20" :list="list"></u-swiper>

			<view class="title">
				天气真好 秋季到来落叶枯黄 风儿也很温柔 似乎是感觉有一种别样的心情 天气晚来秋
			</view>

			<view class="number">
				<image @click.stop="shower=true" v-if="!shower" class="image3" src="../../static/users/zan.png"
					mode="aspectFill"></image>
				<image @click.stop="shower=false" v-if="shower" class="image3" src="../../static/users/zanguo.png"
					mode="aspectFill"></image>
				<view class="text1">15.2w</view>
				<image src="../../static/users/pingnum.png" class="image4" mode="aspectFill"></image>
				<view class="text2">1.2w</view>
			</view>

			<view class="shop">
				<image class="avtral" src="../../static/users/shop.png" mode="aspectFill"></image>
				<image src="../../static/users/vip.png" class="vip_imgage" mode="aspectFill"></image>
				<view class="shop_title">
					鬼灭之刃动漫店
				</view>

				<view class="home_shop">
					7号宿舍楼505
				</view>

				<view class="adddress">
					成都航空职业技术学院龙泉驿校区
				</view>

				<view class="goshop">
					进店逛逛
				</view>
			</view>


		</view>
		<view class="center"></view>

		<view class="ping_jia">
			<view class="comment" v-for="(res, index) in commentList" :key="res.id">
				<view class="left">
					<image :src="res.url" mode="aspectFill" @click="personal"></image>
				</view>
				<view class="right">
					<view class="top">
						<view class="name">{{ res.name }}</view>
						<image @click="res.isshow=true" src="../../static/users/jubao.png" mode=""></image>
						<u-action-sheet @click="jubao" :list="lists" v-model="res.isshow"></u-action-sheet>
					</view>
					<view class="content" @click="huifu">{{ res.contentText }}</view>
					<view class="reply-box">
						<!-- 	<view class="item" v-for="(item, index) in res.replyList" :key="item.index">
							<view class="username">{{ item.name }}</view>
							<view class="text">{{ item.contentStr }}</view>
						</view> -->
						<view class="all-reply" @tap="toAllReply" v-if="res.allReply>=1">
							共{{ res.allReply }}条回复
							<u-icon class="more" name="arrow-right" :size="26"></u-icon>
						</view>
					</view>
					<view class="bottom">
						{{ res.date }}
						<view class="reply">回复</view>
					</view>
					<image class="image_huifu" @click="change" src="../../static/users/pingnum.png" mode=""></image>
					<view class="like" :class="{ highlight: res.isLike }">
						<view class="num">{{ res.likeNum }}</view>
						<u-icon v-if="!res.isLike" name="thumb-up" :size="30" color="#181818" @click="getLike(index)">
						</u-icon>
						<u-icon v-if="res.isLike" name="thumb-up-fill" :size="30" color="red" @click="getLike(index)">
						</u-icon>
					</view>
				</view>
			</view>
		</view>
		<view class="ipt">
			<input type="text" value="" />
		</view>

		<view class="shuru" v-if="showhuifu">
			<view class="ipt">
				<input cursor-spacing="30" maxlength="-1" auto-blur="true" focus="have" @blur="clear" value=""
					placeholder="" />
			</view>
			<view class="send">
				发送
			</view>
		</view>


		<view class="bottoms"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				like: false,
				shower: false,
				have: false,
				list: [{
						image: "../../static/users/banner1.png"
					},
					{
						image: "https://cdn.uviewui.com/uview/swiper/1.jpg"
					},
					{
						image: 'https://cdn.uviewui.com/uview/swiper/2.jpg'
					}
				],
				commentList: [],
				showhuifu: false,
				shows: false,
				lists: [{
					text: '举报该评论'
				}],

			}
		},
		methods: {
			click(index) {
				console.log(index);
			},
			clear() {
				this.showhuifu = false
			},
			change() {
				this.showhuifu = true
				this.have = true
			},
			// 跳转到全部回复
			toAllReply() {
				uni.navigateTo({
					url: '../replay/reply'
				});
			},
			// 回复
			huifu() {

			},
			// 点赞
			getLike(index) {
				this.commentList[index].isLike = !this.commentList[index].isLike;
				if (this.commentList[index].isLike == true) {
					this.commentList[index].likeNum++;
				} else {
					this.commentList[index].likeNum--;
				}
			},
			// 评论列表
			getComment() {
				this.commentList = [{
						id: 1,
						name: '叶轻眉',
						date: '12-25 18:58',
						contentText: '我不信伊朗会没有后续反应，美国肯定会为今天的事情付出代价的',
						url: 'https://cdn.uviewui.com/uview/template/SmilingDog.jpg',
						allReply: 12,
						likeNum: 33,
						isLike: false,
						isshow: false
					},
					{
						id: 2,
						name: '叶轻眉1',
						date: '01-25 13:58',
						contentText: '我不信伊朗会没有后续反应，美国肯定会为今天的事情付出代价的',
						allReply: 0,
						likeNum: 11,
						isLike: false,
						url: 'https://cdn.uviewui.com/uview/template/niannian.jpg',
						isshow: false
					},
					{
						id: 3,
						name: '叶轻眉2',
						date: '03-25 13:58',
						contentText: '我不信伊朗会没有后续反应，美国肯定会为今天的事情付出代价的',
						allReply: 0,
						likeNum: 21,
						isLike: false,
						allReply: 2,
						url: '../../../static/logo.png',
						isshow: false
					},
					{
						id: 4,
						name: '叶轻眉3',
						date: '06-20 13:58',
						contentText: '我不信伊朗会没有后续反应，美国肯定会为今天的事情付出代价的',
						url: 'https://cdn.uviewui.com/uview/template/SmilingDog.jpg',
						allReply: 0,
						likeNum: 150,
						isLike: false,
						isshow: false
					}
				];
			},
			personal() {
				uni.navigateTo({
					url: "../PersonalCenter/PersonalCenter"
				})
			},
			jubao(index) {
				console.log(index);
				uni.navigateTo({
					url: "../report/report"
				})
			}
		},
		onLoad() {
			this.getComment();
		},
	}
</script>

<style lang="scss">
	page {
		background-color: #Fff;
	}

	.head_msg {
		padding: 30rpx;
		position: relative;

		.image1 {
			width: 80rpx;
			height: 80rpx;
		}

		.name {
			position: absolute;
			top: 57rpx;
			left: 130rpx;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: #181818;
		}

		.content {

			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: #666666;
		}

		.date {
			position: absolute;
			left: 261rpx;
			top: 61rpx;
			font-size: 22rpx;
			font-family: PingFang SC;
			font-weight: 300;
			color: #999999;
		}

		.guanzhu {
			position: absolute;
			top: 50rpx;
			right: 30rpx;
			text-align: center;
			line-height: 46rpx;
			width: 120rpx;
			height: 46rpx;
			background: #181818;
			border-radius: 23px;
			font-size: 20rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #FFFFFF;

		}

		.quguan {
			position: absolute;
			top: 50rpx;
			right: 30rpx;
			text-align: center;
			line-height: 46rpx;
			width: 120rpx;
			height: 46rpx;
			background: #B5B3B2;
			border-radius: 23px;
			font-size: 20rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
		}

		.title {
			margin: 30rpx 0 0 15rpx;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #181818;
		}

		.number {
			position: absolute;
			top: 30rpx;
			left: 20rpx;
			width: 250rpx;
			position: relative;

			.image3 {
				position: absolute;
				top: 5rpx;
				width: 26rpx;
				height: 22rpx;
			}

			.text1 {
				position: absolute;
				left: 50rpx;
				top: 0rpx;
				font-size: 20rpx;
				font-family: PingFang SC;
				font-weight: 300;
				color: #181818;
			}

			.image4 {
				position: absolute;
				top: 5rpx;
				left: 140rpx;
				width: 24rpx;
				height: 22rpx;
			}

			.text2 {
				position: absolute;
				left: 190rpx;
				top: 0rpx;
				font-size: 20rpx;
				font-family: PingFang SC;
				font-weight: 300;
				color: #181818;
			}
		}

		.shop {
			margin-top: 75rpx;
			width: 690rpx;
			height: 200rpx;
			padding: 30rpx 0 30rpx 0;
			background: #fff;
			border-radius: 20rpx;
			position: relative;

			.avtral {
				width: 180rpx;
				height: 150rpx;
			}

			.vip_imgage {
				position: absolute;
				top: 30rpxrpx;
				left: 121rpx;
				width: 60rpx;
				height: 30rpx;
				z-index: 100;
			}

			.shop_title {
				position: absolute;
				top: 50rpx;
				left: 200rpx;
				font-size: 36rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #181818;
			}

			.home_shop {
				position: absolute;
				top: 83rpx;
				left: 200rpx;
				font-size: 20rpx;
				font-family: PingFang SC;
				font-weight: 300;
				color: #666666;
				line-height: 80rpx;
			}

			.adddress {
				position: absolute;
				top: 143rpx;
				left: 200rpx;
				font-size: 20rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #999999;
			}

			.goshop {
				position: absolute;
				right: 0rpx;
				top: 75rpx;
				width: 160rpx;
				height: 66rpx;
				border: 2rpx solid #181818;
				border-radius: 33rpx;
				text-align: center;
				line-height: 66rpx;
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #181818;
			}
		}

	}

	.center {
		width: 750rpx;
		height: 10rpx;
		background: #F2F4FA;
	}

	.ping_jia {
		.comment {
			display: flex;
			padding: 30rpx;

			.left {
				image {
					width: 64rpx;
					height: 64rpx;
					border-radius: 50%;
					background-color: #f2f2f2;
				}
			}

			.right {
				flex: 1;
				padding-left: 20rpx;
				font-size: 30rpx;
				position: relative;

				.top {
					display: flex;
					justify-content: space-between;
					align-items: center;
					margin-bottom: 10rpx;

					image {
						margin-right: 10rpx;
						width: 26rpx;
						height: 6rpx;
					}

					.name {

						color: #181818;
						font-size: 32rpx;
						font-family: PingFang SC;
						font-weight: 400;
						color: #181818;
					}


				}

				.like {
					position: absolute;
					bottom: 0rpx;
					right: 10rpx;
					display: flex;
					align-items: center;
					color: #9a9a9a;
					font-size: 26rpx;

					.num {
						margin-right: 4rpx;
						color: #181818;
					}

				}

				.image_huifu {
					position: absolute;
					right: 120rpx;
					bottom: 2rpx;
					width: 24rpx;
					height: 22rpx;
				}

				.highlight {
					color: #181818;

					.num {
						color: red;
					}
				}

				.content {
					margin-bottom: 10rpx;
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #181818;
				}

				.reply-box {
					background-color: rgb(242, 242, 242);
					border-radius: 12rpx;

					.item {
						padding: 20rpx;
						border-bottom: solid 2rpx $u-border-color;

						.username {
							font-size: 24rpx;
							color: #999999;
						}

						.text {
							font-size: 24rpx;
							font-family: PingFang SC;
							font-weight: 400;
							color: #181818;
						}
					}

					.all-reply {
						padding: 20rpx 0 20rpx 20rpx;
						display: flex;
						font-size: 24rpx;
						font-family: PingFang SC;
						font-weight: 400;
						color: #181818;
						align-items: center;

						.more {
							margin-left: 6rpx;
						}
					}
				}

				.bottom {
					margin-top: 20rpx;
					display: flex;
					font-size: 24rpx;
					color: #9a9a9a;

					.reply {

						color: #181818;
						margin-left: 10rpx;
					}
				}
			}
		}
	}

	.shuru {
		// padding-bottom:20rpx;
		position: fixed;
		bottom: 0rpx;
		width: 750rpx;
		height: 120rpx;
		background: #F2F4FA;

		.ipt {
			margin: 20rpx 0 30rpx 30rpx;
			width: 570rpx;
			// height: 100rpx;
			background: #FFFFFF;
			border-radius: 50rpx;
			position: absolute;

			input {
				width: 540rpx;
				height: 80rpx;
				margin: 10rpx 0 0 20rpx;
			}
		}

		.image_one {
			position: absolute;
			right: 64rpx;
			top: 36rpx;
			width: 36rpx;
			height: 36rpx;
		}

		.image_two {
			position: absolute;
			right: 64rpx;
			top: 102rpx;
			width: 36rpx;
			height: 36rpx;
		}

		.send {
			position: absolute;
			top: 35rpx;
			right: 30rpx;
			width: 100rpx;
			height: 50rpx;
			background: #181818;
			border-radius: 10rpx;
			text-align: center;
			line-height: 50rpx;
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: #FFFFFF;
		}
	}

	.bottoms {
		width: 750rpx;
		height: 300rpx;
	}
</style>
